<?php

$iSpotlightImages = $qSpotlightImages->num_rows();

if ($iSpotlightImages > 0)
{
	?>
	<div id="<?php echo $this->config->item('site_accr'); ?>_spotlight_cont">
		<div class="<?php echo $this->config->item('site_accr'); ?>_section_header"><?php echo $aMessages['in_focus']; ?></div>
		<?php
		
		for ($i = 0; $i < $iSpotlightImages; $i++)
		{
			$qImageText = $qSpotlightImages->row($i)->qImageText;
			$iImageText = $qImageText->num_rows();
			
			$sExtraClass = '';
			
			if ($i === ($iSpotlightImages - 1))
			{
				$sExtraClass = ' '.$this->config->item('site_accr').'_spotlight_last';	
			}
			
			if ($iImageText === 1)
			{
				?>
				<div class="<?php echo $this->config->item('site_accr'); ?>_spotlight<?php echo $sExtraClass; ?>">
					<div class="spotlight_text_header"><?php echo $qImageText->row(0)->text_header; ?></div>
					<div class="spotlight_image"><img src="/assets/media/web/<?php echo $qSpotlightImages->row($i)->media_subfolder; ?>/<?php echo $qSpotlightImages->row($i)->media_id.'.'.$qSpotlightImages->row($i)->extension_ext; ?>" alt="<?php echo $qImageText->row(0)->text_header; ?>" /></div>
					<div class="spotlight_text_content"><?php echo $qImageText->row(0)->text_content; ?></div>
					<?php
					
					if ($qImageText->row(0)->text_link !== '')
					{
						?>
						<div class="spotlight_text_link"><?php echo $aMessages['find_out_more']; ?></div>
						<?php
					}
					else if ($qImageText->row(0)->page_name !== null)
					{
						?>
						<div class="spotlight_text_link"><a href="/<?php echo $qImageText->row(0)->lang_accr.'/'.$qImageText->row(0)->page_name; ?>"><img src="/assets/images/<?php echo $this->sPlatform; ?>/spotlights/backgrounds/<?php echo $this->sSkinMediaPath; ?>_fom.gif" alt="" />&nbsp;&nbsp;&nbsp;<?php echo $aMessages['find_out_more']; ?></a></div>
						<?php
					}
					
					?>
					<div class="spotlight_footer"></div>
				</div>
				<?php	
			}			
		}
		
		?>
		<div class="<?php echo $this->config->item('site_accr'); ?>_clear"></div>
	</div>
	<?php
}

?>